Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/merge time series schemas #1127

Merged
merged 52 commits into from
Aug 16, 2024
Merged

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jul 20, 2024

Description

  • Merge two core schemata used to specify time series data in a flex model, namely QuantityOrSensor and TimeSeriesOrSensor.
  • Named new schema VariableQuantityField.
  • Backward compatibility: deprecate old schemas, but keep them functioning for now (while logging a deprecation warning).
  • Allow setting a SoC unit directly in some fields (formerly Float fields, and now Quantity fields), while still falling back on the contents of the soc-unit field, for backwards compatibility:
    • soc-at-start
    • soc-min
    • soc-max
  • Allow setting a unit directly in fields that already supported passing a time series:
    • soc-maxima
    • soc-minima
    • soc-targets
  • Allow passing a time series in fields that formerly only accepted passing a fixed quantity or a sensor reference:
    • power-capacity
    • consumption-capacity
    • production-capacity
    • charging-efficiency
    • discharging-efficiency
    • storage-efficiency
    • soc-gain
    • soc-usage
  • Revise docs in flex-model-v2g.rst with regards to passing dynamic power constraints as part of the flex-model
  • Remove all but one mention of the soc-unit field from the docs (still works under the hood)
  • Add test cases for passing a time series to the new schema

Look & Feel

Synchronizes support for specifying time series data in a flex model in three distinct ways:

  • As a constant quantity, such as:
    "10 kW"
    
  • As a time series, such as (NB the below example assumes the unit is specified via a separate field):
    [
        {
            "value": 51,
            "start": "2024-02-04T10:35:00+01:00",
            "end": "2024-02-05T04:25:00+01:00"
        }
    ]
    
  • As a sensor, such as:
    {
        "sensor": 101
    }
    

How to test

See https://github.com/FlexMeasures/flexmeasures/pull/1127/files#diff-1f68bebf4090d2608b43200311d3ebd3e0ad637e2e16cc6a9b14bffaa29757f3R2177

Further Improvements

Related Items

Flix6x added 16 commits July 19, 2024 00:21
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…urce unit for interpreting values without a unit

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Flix6x added 11 commits July 20, 2024 23:24
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…t defined elsewhere, and specifically, let the StorageScheduler get its default SoC unit from the soc-unit field, which lets us allow time series values to be specified as string quantities while preserving backwards compatibility

Signed-off-by: F.N. Claessen <felix@seita.nl>
…nto Quantity fields, by returning the magnitude upon deserialization

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@nhoening
Copy link
Contributor

nhoening commented Aug 7, 2024

In #1128 we also mentioned that:

If this PR is the successor, then it should also take those promises over. They might be rather meaningful for users.

…es representing a time series

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x
Copy link
Contributor Author

Flix6x commented Aug 9, 2024

  • we'd add examples (of scheduling non-MW sensors) to the documentation

Moved to #1139

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
documentation/changelog.rst Outdated Show resolved Hide resolved
documentation/features/scheduling.rst Show resolved Hide resolved
flexmeasures/cli/data_add.py Show resolved Hide resolved
flexmeasures/data/models/planning/storage.py Outdated Show resolved Hide resolved
flexmeasures/data/models/planning/storage.py Outdated Show resolved Hide resolved
flexmeasures/data/schemas/sensors.py Show resolved Hide resolved
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Copy link
Contributor

@victorgarcia98 victorgarcia98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Signed-off-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
@Flix6x Flix6x merged commit a128275 into main Aug 16, 2024
7 checks passed
@Flix6x Flix6x deleted the feature/merge-time-series-schemas branch August 16, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send dynamic powerconstraint in flex-model Schedule non-MW sensors
3 participants